import qs from 'qs';
import { network } from '@/utils';

import { logisCenter } from '../../../../../config/Apis';

export async function queryDeliveryList(params: any) {
  return network.get(logisCenter.order_list, { params });
}

export async function pickupDelivery(params: any) {
  // return network.post(`${logisCenter.order_pickup}?id=${params.id}&isOpen=${params.isOpen}`);
  return network.post(logisCenter.order_pickup, {data: params});
}

export async function modifyPhone(params: any) {
  return network.post(logisCenter.order_editPhone, { data: params });
}

export async function orderProblem(params: any) {
  return network.post(logisCenter.order_problem, { data: params });
}

export async function exportExcel(params: any) {
  return network.get(logisCenter.order_export,{params});
  // window.location.href = `${logisCenter.order_export}?${qs.stringify(params)}`;
}

export async function repeatSms(params: any) {
  return network.post(`${logisCenter.order_repeatSms}?id=${params.id}`);
}

export async function toCab(params: any) {
  return network.post(`${logisCenter.order_toCab}?id=${params.id}`);
}

export async function cancelDelivery(params: any) {
  return network.post(logisCenter.order_cancelDelivery, { data: params });
}

export async function confirmDelivery(params: any) {
  return network.post(logisCenter.order_confirmDelivery, { data: params });
}

export async function queryCount(params: any) {
  return network.get(logisCenter.order_count, { params });
}

export async function signBack(params: any) {
  return network.post(logisCenter.order_sign_back, { data: params });
}

export async function cancelBack(params: any) {
  return network.post(logisCenter.order_cancel_back, { data: params });
}

export async function openCab(params: any) {
  return network.post(logisCenter.order_open_cab, { data: params });
}
